//
//  SelectColor1ViewController.m
//  testSyntextApp
//
//  Created by MICHAEL on 15/8/4.
//  Copyright (c) 2015年 kyy. All rights reserved.
//

#import "SelectColor1ViewController.h"
#import "SelectColorViewController.h"
@interface SelectColor1ViewController ()
@property (nonatomic,strong) UIButton *goToNextStageButton;
@end

@implementation SelectColor1ViewController

-(UIButton*)goToNextStageButton{
    if (!_goToNextStageButton) {
        _goToNextStageButton=[[UIButton alloc]initWithFrame:CGRectMake(100, 100, 150, 50)];
        _goToNextStageButton.backgroundColor=[UIColor greenColor];
        [self.view addSubview:_goToNextStageButton];
    }
    return _goToNextStageButton;

}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.goToNextStageButton addTarget:self action:@selector(goToNextStage) forControlEvents:UIControlEventTouchUpInside];
    // Do any additional setup after loading the view.
}

-(void)goToNextStage{
    SelectColorViewController *select=[[SelectColorViewController alloc]init];
    self.success=^(NSString * string){
        [self.goToNextStageButton setTitle:string forState:UIControlStateNormal];
    };

    [self.navigationController pushViewController:select animated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
